﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HDHack
{
    class Player
    {
        public int x;
        public int y;
        public int vision;
        public char icon;
        public int hp;
        public int atk;
        public int def;
        public int LastLevelIndex;
        public int TravelDir;
        public enum TravelDirections { ComingUp, GoingDown, Starting };
        public int CurrentLevelIndex;
        public List<Item> Inventory = new List<Item>();

        public List<BodyPart> BodyParts = new List<BodyPart>();
        public MainHand mainHand = new MainHand();
        public Arms arms = new Arms();
        public Torso torso = new Torso();        

        public Player(int ix, int iy, char iicon, int ihp, int iatk, int idef)
        {
            x = ix;
            y = iy;
            icon = iicon;
            vision = 5;
            hp = ihp;
            atk = iatk;
            def = idef;
            LastLevelIndex = -1;
            CurrentLevelIndex = 0;

            BodyParts.Add(mainHand);
            BodyParts.Add(torso);
            BodyParts.Add(arms);
            

        }

        public void UnEquipItem(BodyPart bp)
        {
            switch (bp.EquipmentPoint)
            {
                case HDHackEnumerations.EquipmentPoints.MainHand:
                    mainHand.EquipedItem = null;
                    break;
                case HDHackEnumerations.EquipmentPoints.Arms:
                    arms.EquipedItem = null;
                    break;
                default:
                    break;
            }

        }

        public void EquipItem(Item i)
        {
            switch (i.EquipedAt)
            {
                case HDHackEnumerations.EquipmentPoints.MainHand:
                    mainHand.EquipedItem = i;
                    break;
                case HDHackEnumerations.EquipmentPoints.Arms:
                    arms.EquipedItem = i;
                    break;
                default:
                    break;
            }
        }

        public void PickUpItems(Item i)
        {
            Inventory.Add(i);
        }

        public void DropItem(Item i)
        {
            Inventory.Remove(i);
        }

    }
}
